﻿<?php
/*
    Template Name: DanhBa
*/
?>
<?php get_header()?>
<!--div class="nav navbar-inverse">
    <a class="navbar-brand">Danh Ba</a>
    <button type="button" data-toggle="collapse" data-target="#mycollapse" class="navbar-toggle">
        <i class="icon-bar"></i>
        <i class="icon-bar"></i>
        <i class="icon-bar"></i>
    </button>
</div-->
<div class="panel-group" id="mycollapse">
<?php
global $wpdb;
$thongtin = $wpdb->get_results("SELECT * FROM ttcn_danhba " . $exQuery . " ORDER BY NgayTao DESC");
foreach ($thongtin as $canhan) {
    /*Show Content from database*/
    ?>
    <div class="panel panel-default" >
        <div class="panel-heading">
            <h4 class="panel-title">
                <a data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $canhan->ID ;?>">
                    <?php echo $canhan->Ten;?>
                </a>

                    <?php
                    if ( is_user_logged_in() ) {
                        echo "<a href='http://ttcn.me/wp-admin/?page=Quan_ly_danh_ba&suaid=".$canhan->ID."' class=' pull-right'>Sửa thông tin</a>";
                    }
                    ?>
            </h4>
        </div>
        <div id="collapse<?php echo $canhan->ID ;?>" class="panel-collapse collapse ">
            <div class="panel-body">
                <div class="row">
                    <ul class="list-group">
                        <li class="list-group-item"><span class="label label-primary">So Dien Thoai:</span><span><?php echo $canhan->SoDt;?></span></li>
                        <li class="list-group-item"><span class="label label-primary">Email:</span><span><?php echo $canhan->Email;?></span></li>
                        <li class="list-group-item"><span class="label label-primary">Ngay Sinh:</span><span><?php echo $canhan->NgaySinh;?></span></li>
                        <li class="list-group-item"><span class="label label-primary">Dia Chi:</span><span><?php echo $canhan->DiaChi;?></span></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
<?php
}
?>
</div>
<?php get_footer()?>